import request from '@/utils/request'
import { projectApiUrl } from '../config'
import request2 from '@/utils/request2'

/**
 * 分包商月度考核列表
 * @param parameter
 */
export function getMonthAssessmentList(parameter) {
  return request2({
    url: projectApiUrl + '/monthly-ratings/list',
    method: 'post',
    data: parameter
  })
}

export function batchList(parameter) {
  return request2({
    url: projectApiUrl + '/monthly-ratings/batchList',
    method: 'post',
    data: parameter
  })
}

export function serviceUpdate(parameter) {
  return request2({
    url: projectApiUrl + '/monthly-ratings/service-update',
    method: 'post',
    data: parameter
  })
}
export function queryBatchButton(parameter) {
  return request2({
    url: projectApiUrl + '/monthly-ratings/queryBatchButton',
    method: 'post'
  })
}
export function listTotalQuery(params) {
  return request2({
    url: projectApiUrl + '/monthly-ratings/listTotalQuery/list',
    method: 'post',
    data: params
  })
}

export function batchHeader(params) {
  return request2({
    url: projectApiUrl + '/monthly-ratings/batchHeader/' + params.id,
    method: 'get',
    params
  })
}
export function querySafeTyScore(data) {
  return request2({
    url: projectApiUrl + '/monthly-ratings/query-safety-score',
    method: 'post',
    data
  })
}
//月度批量考核打分
export function assessmentBatchDetails(data) {
  return request2({
    url: projectApiUrl + '//monthly-ratings/assessment-batch-details',
    method: 'post',
    data
  })
}

/**
 * 分包商月度考核时间
 * @param parameter
 */
export function getMonthAssessmentTime(parameter) {
  return request({
    url: projectApiUrl + '/monthly-ratings/assessmentTime',
    method: 'get',
    params: parameter
  })
}

/**
 * 查看分包商月度考核详情--表头信息
 * @param id
 */
export function getMonthHeaders(data) {
  return request2({
    url: projectApiUrl + '/monthly-ratings/assessment-details-header',
    method: 'get',
    params: data
  })
}

/**
 * 查看分包商月度考核详情--内容信息
 * @param id
 */
export function getMonthContent(data) {
  return request2({
    url: projectApiUrl + '/monthly-ratings/assessment-details-content',
    method: 'get',
    params: data
  })
}

/**
 * 查看分包商月度考核详情--内容信息编辑
 * @param id
 */
export function getMonthContents(data) {
  return request({
    url: projectApiUrl + '/monthly-ratings/assessment-edit-details-content',
    method: 'get',
    params: data
  })
}

/**
 * 月度考核提交审核
 *
 */
export function getMonthAapprove(data) {
  return request({
    url: projectApiUrl + '/monthly-ratings/assessment-details',
    method: 'post',
    data: data
  })
}

/**
 * 分包商月度考核统计
 * @param
 */
export function getMonthTotal(data) {
  return request({
    url: projectApiUrl + '/monthly-ratings/listTotalQuery',
    method: 'get',
    params: data
  })
}

/**
 * 分包商月度考核详情统计
 * @param
 */
export function getMonthDetailsTotal(id) {
  return request({
    url: projectApiUrl + '/monthly-ratings/details-total/' + id,
    method: 'get',
    id
  })
}

/**
 * 分包商月度考核提交审核
 * @param data
 */
export function monthReview(data) {
  return request({
    url: projectApiUrl + '/subcontractors/month/review',
    method: 'post',
    data: data
  })
}

/**
 * 编辑分包商月度考核评分
 * @param data
 */
export function editMothAssessment(data) {
  return request({
    url: projectApiUrl + '/subcontractors/month-assessment',
    method: 'post',
    data: data
  })
}

/**
 * 生成月度考核数据
 * @param data
 */
export function getMothAssessment(data) {
  return request({
    url: '/cscec-project-business/monthly-ratings/create-assessment-form',
    method: 'post',
    data: data
  })
}

/**
 * 打印月度考核数据
 * @param data
 */
export function getMothAssessmentDoc(data) {
  return request({
    url: '/cscec-project-business/monthly-ratings/doc',
    method: 'get',
    params: data
  })
}

/**
 * 批量打印月度考核数据
 * @param data
 */
export function monthlyRatingsDocPrintBatch(data) {
  return request({
    url: projectApiUrl + '/monthly-ratings/doc-print-batch',
    method: 'post',
    data
  })
}
/**
 * 获取分包商月度考核待办数据
 * @param data
 */
export function listByBusiness(data) {
  return request({
    url: projectApiUrl + '/monthly-ratings/listByBusiness',
    method: 'post',
    data
  })
}
/**
 * 确认处理
 * @param data
 */
export function assessmentBatchConfirm(data) {
  return request({
    url: projectApiUrl + '/monthly-ratings/assessment-batch-confirm',
    method: 'post',
    data
  })
}
